<?php
require_once("../includes/config.php");
include DIR_INCLUDES_FT.'bootstrap.php';

switch ($_POST['accao']){
	case 'verifica_cliente':
		$num_rep = Doctrine_Query::create()->from("Clientes c")
			->where("c.nome = ? and c.id != ?", array($_POST['nome'],$_POST['id']))
			->count();
		if($num_rep > 0){
			echo json_encode(false);
		} else {
			echo json_encode(true);
		}
	break;
}
?>